import { Service } from "cl-admin";
import BaseService from "@/service/base";
// 年终报表-集团
@Service("homeGroup")
class HomeGroup extends BaseService {
	getParams({ dateArr, biz_id, ...args }) {
		return { ...args, year: dateArr?.[0] || '', month: dateArr?.[1] || '' }
	}
	// 顶部卡片
	topCards(query) {
		let params = this.getParams(query)
		return this.$get('/topCards', { params })
	}
	// 顶部图表
	topChart(query) {
		let params = this.getParams(query)
		return this.$get('/topChart', { params })
	}
	// 中部卡片
	middleCards(query) {
		let params = this.getParams(query)
		return this.$get('/middleCards', { params })
	}
	// 中部图表
	middleChart(query) {
		let params = this.getParams(query)
		return this.$get('/middleChart', { params })
	}
	// 底部卡片
	bottomCards(query) {
		let params = this.getParams(query)
		return this.$get('/bottomCards', { params })
	}
	// 底部图表
	bottomChart(query) {
		let params = this.getParams(query)
		return this.$get('/bottomChart', { params })
	}
	// 清除缓存
	clearCache(query) {
		let params = this.getParams(query)
		return this.$get('/clearCache', { params })
	}

}
export default HomeGroup
